package com.william.yun.yunliwuli.api.rest;

/**
 * ClassName: LedApi <br/>
 * Description:  <br/>
 * date: 2021/3/12 15:38<br/>
 *
 * @author william <br/>
 */

import com.alibaba.fastjson.JSONObject;
import com.william.yun.yunliwuli.api.HttpResponse;
import com.william.yun.yunliwuli.api.request.led.LabelLedRequest;
import com.william.yun.yunliwuli.api.request.led.PubBindingUpdateLedRequest;
import com.william.yun.yunliwuli.service.impl.BindingServiceImpl;
import com.william.yun.yunliwuli.service.impl.LabelServiceImpl;

/**
 * 灯
 */
public class LedApi extends BaseApi{

    /**
     * 标签灯控制接口
     * @param request
     * @param token
     * @return
     */
    public HttpResponse labelLED(LabelLedRequest request, String token){
        JSONObject jsonObject = new LabelServiceImpl().putLabelLED(getJsonParam(request), token);
        return JSONObject.toJavaObject(jsonObject, HttpResponse.class);
    }

    /**
     * 修改商品内容与模板绑定，灭灯点灯
     * @param request
     * @param token
     * @return
     */
    public HttpResponse pubBindingUpdateLED(PubBindingUpdateLedRequest request, String token){
        JSONObject jsonObject = new BindingServiceImpl().postPubBindingUpdateLED(getJsonParam(request), token);
        return JSONObject.toJavaObject(jsonObject, HttpResponse.class);
    }


}
